<?php
App::uses('AppController', 'Controller');
/**
 * courses Controller
 *
 * @property course $course
 */
class CoursesDisciplinesController extends AppController {
	public $components = array('RequestHandler');
	
	public function delete($course = null, $discipline) {
		$this->loadModel('CoursesDiscipline');
		if($this->RequestHandler->isAjax())
		{
			$this->autoRender = false;
			$row = $this->CoursesDiscipline->find('first', array('conditions' => array('CoursesDiscipline.course_id' => $course, 'CoursesDiscipline.discipline_id' => $discipline)));
			$this->CoursesDiscipline->delete($row['CoursesDiscipline']['id']);	
		}
	}

}
